export const loginMixin = {
  created: function () {},
  methods: {
    /**
     * @description 登录
     */
    loginFromSSO() {
      this.loading = true
      const params = new URLSearchParams(window.location.hash.split('?')[1])
      const obj = {}
      params.forEach((v, k) => (obj[k] = v))
      if (obj.token && obj.tokenHead) {
        this.$store.dispatch('user/loginFromSSO', obj)
        this.$router.push({ path: '/' })
      }
    }
  }
}
